package cn.com.blueInfo.bpm.system.convert;

import cn.com.blueInfo.bpm.common.convert.BaseConvert;
import cn.com.blueInfo.bpm.system.entity.DictItem;
import cn.com.blueInfo.bpm.system.request.DictItemDTO;
import cn.com.blueInfo.bpm.system.response.DictItemVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

/**
 * 枚举项表 对象转换
 * @author suxch
 * @since 2025-08-31 16:20:56
 */
@Mapper(componentModel = "spring")
public interface DictItemConvert
        extends BaseConvert<DictItem, DictItemDTO, DictItemVO> {

    DictItem dtoToEntity(DictItemDTO dto);

    DictItem dtoToEntity(DictItemDTO.UpdatePartialDTO dto);

    @Mapping(source = "status", target = "status", qualifiedByName = "enumToDesc")
    @Mapping(source = "deleted", target = "deleted", qualifiedByName = "enumToDesc")
    DictItemVO entityToVO(DictItem entity);

}